import { throttle } from "../练习/utils/throttle"
const button = document.querySelector("button");
let count: number = 0

// HTMLButtonElement | null
// 有这个方法就执行，没有就不执行
// 最优方法
// button?.addEventListener()

// 断言
// (button as HTMLButtonElement).addEventListener("click",() =>{

// })

// 非空断言
button!.addEventListener("click", throttle((event: MouseEvent) => {
    count++;
    (event.target! as HTMLButtonElement).innerHTML = `点击：${count}次`

}, 2000))


export default null